/*
 * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.inspur.edp.cdp.cdf.component.metadata.service;

import com.inspur.edp.cdp.cdf.component.metadata.CommonComponentMetadata;
import com.inspur.edp.cdp.cdf.component.metadata.common.MetadataCreateStrategy;
import com.inspur.edp.cdp.cdf.component.metadata.common.MetadataHeaderInfo;
import com.inspur.edp.lcm.metadata.api.entity.GspMetadata;

/**
 * 功能描述:通用构件设计时服务,已知：bef TCC构件在使用
 *
 * @ClassName: CommonComponentDtService
 * @Author: Fynn Qi
 * @Date: 2021/4/22 13:41
 * @Version: V1.0
 */
public interface CommonComponentDtService {

    /**
     * 指定路径下是否存在指定名称的通用构件元数据
     *
     * @param metadataCode 通用构件元数据编号
     * @param path         指定的元数据路径
     * @return 是否存在同名通用构件元数据
     */
    boolean exist(String metadataCode, String path);

    /**
     * 设计时创建通用构件元数据接口
     *
     * @param metadataHeaderInfo 元数据Header信息
     * @param commonComponent    构件实体
     * @param path               要生成的构件元数据的相对路径，会根据当前的path值自动生成到当前元数据工程中的ccmp文件夹下
     * @param createStrategy     元数据创建策略
     * @return 生成的构件元数据
     */
    GspMetadata create(MetadataHeaderInfo metadataHeaderInfo, CommonComponentMetadata commonComponent, String path,
        MetadataCreateStrategy createStrategy);

}
